#include<stdio.h>
int f(int a,int x);
int main()
{ 
	int x=1,t=0,y=0,u=0,i=0,o=0;
       while(t!=1 || y!=2 || u!=4 || i!=5 || o!=0) {
		t = f(x,2);
		y = f(x,3);
		u = f(x,5);
		i = f(x,6);
		o = f(x,7);  
		x++;

	}  
	printf("%d\n",(x-1));
	return 0;
} 
int f(int a,int b)
{     
	int t=0;
	t =(a%b);
	return (t);


}

